<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="referrer" content="no-referrer" />
    <title>Test</title>
    <style>
        body {
            position: absolute;
            margin: 0;
            width: 100%;
            height: 100%;
        }

        #mapContainer {
            left: 0px;
            top: 0px;
            width: 100%;
            height: 100%;
            float: left;
        }
    </style>
</head>

<body>
    <div id="mapContainer" style="position: relative;"></div>
</body>
<script src='/GiswayEngine.js'></script>
<script type="text/javascript">
    window.app = new GE.App('mapContainer', {
        position: [121.544119, 28.587165, 1000],
        lookAt: [121.544119, 28.587165, 0],
        cameraScrollSpeed: 5,
        minZoom: 1,
        maxZoom: 18,
        ambientLightIntensity: 5,
        useDefaultTexture: true, //是否使用瓦片默认纹理
        // fogColor: '#FF1493',//'#FFFAFA', //'#66CCFF',// //雾的颜色
        // fogStartAngle: 20, //雾开始的角度
        useCarpet: true,
        background: "Fog",
        baseLayer: [
            {
                url: ' https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
                // url: 'http://115.236.87.26:8848/googleTiles/china_image/{z}/{y}/{x}.jpg',
                urlDecimal: true,
                tileType: 'image',
                canNotSelect: true, //true表示该图层不参与射线拾取，false表示图层参与射线拾取
            },
            {
                url: '/examples/resources/ShpCLipper/{z}/{y}/{x}.shp',
                urlDecimal: true,
                tileType: 'shape',
                canNotSelect: true, //true表示该图层不参与射线拾取，false表示图层参与射线拾取
            }
        ]
    });

    // window.app.on('Click', function (e) {
    //     console.log(e);
    // });

    //tiles3d(); 
    fbx();
    // loadShapeFile();

    function loadShapeFile() {
        let shapeObject = new GE.ShapeObject({
            url: '/examples/resources/shp/yuhang+.shp',
            merge: true
        });
        app.add(shapeObject);
    }
 
    function fbx() {
        let model = new GE.OverLay({
            type: 'fbx',
            url: '/examples/resources/fbx/xqazm.FBX',
            position: [120.170646,30.28362, 0],//[121.544119, 28.587165, 50],
            success: function () {
                console.log('fbx loaded!');
            }
        });

        app.add(model);
        window.model = model;
    }

    function tiles3d() {
        let tiles3d = new GE.Tiles3d({
            url: '/examples/resources/3dtiles/goodguizhou/tileset.json',
            location: [120.12677193212092, 30.26499469319121, 10],
            autoLocate: true,
            maxSize: 2600,
            // maxDepth: 18
        });
        app.add(tiles3d);
    }

</script>

</html>